package com.java.Enum;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author: ZhangJin
 * @Date: 2020/9/5 17:10
 */
@Slf4j
public enum StoreType {

    StoreType1("1","商业街店铺"),
    StoreType2("2","社区底商"),
    StoreType3("3","写字楼配套"),
    StoreType4("4","购物百货中心"),
    StoreType5("5","临街门面"),
    StoreType6("6","档口摊位"),
    StoreType7("7","没有要求");

   private String Type;
   private String Explain;

    StoreType(String type, String explain) {
        Type = type;
        Explain = explain;
    }

    public String getExplain() {
        return Explain;
    }

    public String getType() {
        return Type;
    }

    public static StoreType getType(String Explain) {
        if (Explain == null || Explain.equals(" ")){
            return StoreType7;
        }
        if (Explain.equals(StoreType1.getExplain()))
            return StoreType1;
        if (Explain.equals(StoreType2.getExplain()))
            return StoreType2;
        if (Explain.equals(StoreType3.getExplain()))
            return StoreType3;
        if (Explain.equals(StoreType4.getExplain()))
            return StoreType4;
        if (Explain.equals(StoreType5.getExplain()))
            return StoreType5;
        if (Explain.equals(StoreType6.getExplain()))
            return StoreType6;
        return StoreType7;
    }

    public static StoreType getTypebyType(String type) {
        if (type.equals(StoreType1.getType()))
            return StoreType1;
        if (type.equals(StoreType2.getType()))
            return StoreType2;
        if (type.equals(StoreType3.getType()))
            return StoreType3;
        if (type.equals(StoreType4.getType()))
            return StoreType4;
        if (type.equals(StoreType5.getType()))
            return StoreType5;
        if (type.equals(StoreType6.getType()))
            return StoreType6;
        return StoreType7;

    }

}
